<%--
  Created by IntelliJ IDEA.
  User: hsy
  Date: 2023/6/3
  Time: 11:16
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<%--共同侧边栏--%>
<%@ include file="sidebar.jsp" %>
<%
  int userID = Integer.parseInt(request.getParameter("UserID"));
%>
<script>
    function validateForm() {
        // 获取密码和确认密码输入框的值
        var newPassword = document.getElementById("newPassword").value;
        var confirmPassword = document.getElementById("confirmPassword").value;

        // 判断密码和确认密码是否一致
        if (newPassword !== confirmPassword) {
            alert("密码和确认密码不一致，请重新输入！");
            return false;
        }

        return true;
    }
</script>

<head>
    <title>修改用户信息</title>
</head>
<link rel="stylesheet" type="text/css" href="css/userModify.css">

<body>
<h2>
    <span>请</span>填<span>写要修改的字段,不修改则不写</span>
</h2>

<form action="UserModify" method="post" onsubmit="return validateForm()">
    <label>用户id:</label>
    <input type="number" name="userId" value="<%=userID%>" readonly>
    <label>用户名称:</label>
    <input type="text" name="userName" maxlength="25">
    修改密码
    <input type="password" maxlength="25" name="newPassword" id="newPassword">
    确认密码
    <input type="password" maxlength="25" name="confirmPassword" id="confirmPassword">
    <label>邮箱</label>
    <input type="text" name="userEmail">
    <input type="submit"></input>
</form>
</body>
</html>
